home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fritz: All Fritz
/
All Fritz.zip
/
All Fritz
/
FILES
/
PROGSCAL
/
TINYPASC.LZH
/
TU.GRM
< prev
next >
Wrap
Text File
|
1986-02-17
|
1KB
|
28 lines
\ TU.GRM -- tiny Pascal grammar held to 25 productions
Goal -> FDeclList
FDeclList -> FDeclList FuncDecl ;
-> FuncDecl ;
FuncDecl -> FUNCTION <identifier> ( ExprList ) ; Stmt #FDECL
-> VAR ExprList #VDECL \ Global variables
\ ExprList must be identifiers only
Stmt -> <identifier> := Expr #ASSIGN
-> IF Expr THEN Stmt ELSE Stmt #IFTHEN
-> WHILE Expr DO Stmt #WHILEDO
-> BEGIN StmtList END #BLOCK
-> Expr #SEXPR \ procedure call only!
StmtList -> StmtList Stmt ; #STLIST2
-> <empty>
Expr -> Expr + Term #ADDOPR
-> Expr - Term #SUBOPR
-> Term
Term -> Term * Primary #MPYOPR
-> Term / Primary #DIVOPR
-> Primary
Primary -> ( Expr ) #PAREN
-> <integer> \ only type INTEGER supported
-> <string>
-> <identifier> \ variable or function call w/o parameters
-> <identifier> ( ExprList ) #FUNCP
ExprList -> ExprList , Expr #EXPRLIST2
-> Expr #EXPRLIST1